package com.mbrs;

import erp.ERP;
import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.kafka.config.TopicBuilder;

@SpringBootApplication
public class MembersApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(
            SpringApplicationBuilder builder) {
        return builder.sources(MembersApplication.class);
    }

    @Bean
    public NewTopic topic() {
        return TopicBuilder.name("process")
                .partitions(10)
                .replicas(1)
                .build();
    }

    public static void main(String[] args) {
        ERP.useAnnotation();
        SpringApplication.run(MembersApplication.class, args);
    }

}
